package com.hmall.search.pojo;

import com.hmall.common.pojo.Item;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Arrays;
import java.util.List;

@Data
@NoArgsConstructor
public class ItemDoc {
    private Long id;
    private String name;
    private Long price;
    private Integer stock;
    private String image;
    private String category;
    private String brand;
    private String spec;
    private Integer sold;
    private Integer commentCount;
    private Boolean isAD;
    private Integer status;
    private List<String> suggestion;

    public ItemDoc(Item item){
     this.id = item.getId();
     this.name = item.getName();
     this.price = item.getPrice();
     this.stock = item.getStock();
     this.image = item.getImage();
     this.category = item.getCategory();
     this.brand = item.getBrand();
     this.spec = item.getSpec();
     this.sold = item.getSold();
     this.commentCount = item.getCommentCount();
     this.isAD = item.getIsAD();
     this.status = item.getStatus();
      this.suggestion = Arrays.asList(this.brand,this.category);
    }
}
